<template>
  <div class="recommend-item">
    <div class="image-container">
      <img :src="album.image" :alt="album.name" />
      <div class="image-overlay">
        <h4 class="album-title">{{ album.name }}</h4>
        <div class="album-stats">
          <div class="stat-item">
            <span class="icon" aria-label="点赞">👍</span>
            <span>{{ album.likes }}</span>
          </div>
          <div class="stat-item">
            <span class="icon" aria-label="浏览">👀</span>
            <span>{{ album.views }}</span>
          </div>
          <div class="stat-item">
            <span class="icon" aria-label="评论">💬</span>
            <span>{{ album.comments }}</span>
          </div>
          <div class="stat-item">
            <span class="icon" aria-label="下载">📥</span>
            <span>{{ album.downloads }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
defineProps({
  album: {
    type: Object,
    required: true,
  },
});
</script>

<style scoped>
.recommend-item {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recommend-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.image-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  color: white;
}

.album-title {
  font-size: 1.1rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 限制两行 */
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.album-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

.icon {
  font-size: 1rem;
}
</style>